package com.hxzy.mapstruct;

import com.hxzy.controller.admin.employee.req.EmployeeAddReq;
import com.hxzy.controller.admin.employee.resp.EmployeeEditResp;
import com.hxzy.entity.Employee;
import org.mapstruct.Mapper;

/**
 * mapstruct的写法
 */
@Mapper
public interface EmployeeMapStruct {

    EmployeeMapStruct INSTANCE = org.mapstruct.factory.Mappers.getMapper(EmployeeMapStruct.class);

    /**
     * 把EmployeeAddReq的值复制到Employee里面
     * @param req
     * @return
     */
    Employee convert(EmployeeAddReq req);

    /**
     * 把数据库的值复制到对象
     * @param db
     * @return
     */
    EmployeeEditResp convert(Employee db);
}
